program Telecasting_station;
const
  fi = '114.in';
  fo = '114.out';
  max = 15000;
var
  x, p : array[1..max] of word;
  n, sum : longint;

procedure inp;
var
  i : longint;
begin
  read(n);
  for i := 1 to n do
  begin
    read(x[i], p[i]);
    inc(sum, p[i]);
  end;
end;

procedure swap(i, j : longint);
var
  temp : longint;
begin
  temp := x[i];
  x[i] := x[j];
  x[j] := temp;
  temp := p[i];
  p[i] := p[j];
  p[j] := temp;
end;

procedure sort(l, r : longint);
var
  i, j : longint;
  k : longint;
begin
  if l >= r then exit;
  i := l;
  j := r;
  k := x[l + random(r-l+1)];
  repeat
    while x[i] < k do inc(i);
    while x[j] > k do dec(j);
    if i <= j then
    begin
      swap(i, j);
      inc(i); dec(j);
    end;
  until i > j;
  sort(i, r); sort(l, j);
end;

procedure process;
var
  i, count : longint;
  need, posi : real;
begin
  sort(1, n);
  need := 1.0*sum/2;
  count := 0;
  for i := 1 to n do
  begin
    if count > need then
    begin
      posi := x[i-1];
      break;
    end;
    inc(count, p[i]);
  end;
  writeln(posi:0:5);
end;

begin
  assign(input, fi); reset(input);
  assign(output, fo); rewrite(output);

  inp;
  process;

  close(output);
  close(input);
end.